package com.cfs.config.web;

import java.util.List;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by Administrator on 2017/7/4/004.
 */
@SuppressWarnings("ALL")
@Configuration
public class CustomWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
        registry.addResourceHandler("/durid/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
        registry.addResourceHandler("/resources/**").addResourceLocations("classpath:/resources/");
        registry.addResourceHandler("/favicon.ico").addResourceLocations("classpath:/resources/");
        registry.addResourceHandler("/images/favicon-*").addResourceLocations("classpath:/resources/images/");
        registry.addResourceHandler("/").addResourceLocations("/");

    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(appAuthInterceptor).addPathPatterns("/api/v1/**");
//        registry.addInterceptor(webApiInterceptor).addPathPatterns("/api/web/**");
//        registry.addInterceptor(tAppAuthInterceptor).addPathPatterns("/api/t1/**");
//        registry.addInterceptor(scheduleInterceptor).addPathPatterns("/api/schedule/**");
    }

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
//    	argumentResolvers.add(currAppUserHandlerMethodArgumentResolver);
    }

}
